fix: add type validation in DatetimeParser.parse() to handle list, dict, and None inputs#785
Closed
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Closed
Conversation
…ct, and None inputs This fix addresses TypeError issues reported in oncall issue #9163 and similar issues where DatetimeParser.parse() is called with invalid input types (list, dict, None) instead of expected timestamp types (str, int, float). The error occurred when concurrent cursor state converters attempted to parse partitioned state structures that contained lists or nested dictionaries as cursor values. This affected multiple connectors including source-zendesk-support, source-intercom, and source-stripe. Changes: - Add explicit type validation at the start of parse() to reject None, list, and dict inputs - Provide clear error messages indicating the expected types vs actual type received - Add try-catch blocks around timestamp conversions for better error handling - Add comprehensive test coverage for all invalid input types Fixes: airbytehq/oncall#9163 Related: airbytehq/oncall#9126, airbytehq/oncall#9138, airbytehq/oncall#8674, airbytehq/oncall#8154, airbytehq/oncall#8386, airbytehq/oncall#7783, airbytehq/oncall#7473 Co-Authored-By: unknown <>
Contributor
Author
Original prompt from API User |
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Testing This CDK VersionYou can test this version of the CDK using the following: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1760018855-fix-datetime-parser-type-handling#egg=airbyte-python-cdk[dev]' --help
# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1760018855-fix-datetime-parser-type-handlingHelpful ResourcesPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
Co-Authored-By: unknown <>
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Testing This CDK VersionYou can test this version of the CDK using the following: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1760018855-fix-datetime-parser-type-handling#egg=airbyte-python-cdk[dev]' --help
# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1760018855-fix-datetime-parser-type-handlingHelpful ResourcesPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: add type validation in DatetimeParser.parse() to handle list, dict, and None inputs
Summary
This PR fixes the
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'reported in oncall issue #9163 and similar issues affecting multiple connectors (Zendesk Support, Intercom, Stripe).The error occurred when
DatetimeParser.parse()was called with invalid input types (list, dict, None) instead of expected timestamp types (str, int, float). This commonly happens when concurrent cursor state converters attempt to parse partitioned state structures that contain nested arrays or dictionaries.Changes:
parse()to reject None, list, and dict inputs with clear error messagesReview & Testing Checklist for Human
This is a defensive fix with moderate risk. Please verify:
Notes
Link to Devin run: https://app.devin.ai/sessions/954333332fc24e6d8f5320322a82a2f2
Requested by: agarctfi